package com.smartwasser.yunhtgl.apphtgl.activity;

import android.view.View;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.smartwasser.yunhtgl.apphtgl.R;
import com.smartwasser.yunhtgl.apphtgl.base.BaseActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import uk.co.senab.photoview.PhotoView;
import uk.co.senab.photoview.PhotoViewAttacher;

import static com.smartwasser.yunhtgl.apphtgl.network.Retrofits.base;


/**
 * Created by Administrator on 2018/7/12.
 */

public class ImageLookActivity extends BaseActivity {
    @BindView(R.id.tv_toolbar)
    TextView tv_toolbar;
    @BindView(R.id.photo_look)
    PhotoView phote_look;
    PhotoViewAttacher mAttacher;
    private String mImgUrl;

    @Override
    public void setContentLayout() {
        setContentView(R.layout.image_look);
        ButterKnife.bind(this);
    }

    @Override
    public void initView() {
        tv_toolbar.setText("详情");
        mImgUrl = base + getIntent().getStringExtra("url");
    }

    @Override
    public void initData() {
        mAttacher = new PhotoViewAttacher(phote_look);
        Glide.with(this).load(mImgUrl).into(phote_look);
        mAttacher.update();
    }

    @OnClick({R.id.back})
    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.back:
                finish();
                break;
        }
    }
}
